// @ts-ignore
/* eslint-disable */
import request from '@/request'

/** 创建对话历史 用户创建对话历史记录 POST /chatHistory/add */
export async function addChatHistory(
  body: API.ChatHistoryAddRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseLong>('/chatHistory/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 删除对话历史 管理员根据对话历史ID删除记录 POST /chatHistory/delete */
export async function deleteChatHistory(body: API.DeleteRequest, options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>('/chatHistory/delete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 根据ID获取对话历史 管理员根据对话历史ID获取详细信息 GET /chatHistory/get */
export async function getChatHistoryById(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getChatHistoryByIdParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseChatHistory>('/chatHistory/get', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** 根据ID获取对话历史VO 管理员根据对话历史ID获取详细信息 GET /chatHistory/get/vo */
export async function getChatHistoryVoById(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getChatHistoryVoByIdParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseChatHistoryVO>('/chatHistory/get/vo', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** 获取最新对话历史 根据应用ID获取最新的对话历史，仅应用创建者和管理员可见 GET /chatHistory/latest */
export async function getLatestChatHistory(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getLatestChatHistoryParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageChatHistoryVO>('/chatHistory/latest', {
    method: 'GET',
    params: {
      // limit has a default value: 10
      ...params,
    },
    ...(options || {}),
  })
}

/** 分页获取所有对话历史 管理员分页获取所有对话历史，用于内容监管 POST /chatHistory/list/page/vo/admin */
export async function listChatHistoryVoByPageAdmin(
  body: API.ChatHistoryQueryRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageChatHistoryVO>('/chatHistory/list/page/vo/admin', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 删除自己的对话历史 用户删除自己的对话历史 POST /chatHistory/my/delete */
export async function deleteMyChatHistory(
  body: API.DeleteRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean>('/chatHistory/my/delete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}
